package com.huifan.demo.revenue.servyou;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: liuchenhui
 * @create: 2019-08-13 20:26
 **/
public class EmployeeReport {

    public static final String ZJLX = "居民身份证";
    public static final String GJ = "中国";
    public static final String STATUS = "非正常";
    public static final String SFGY = "雇员";
    public static final String RZSGRQ = "2019-01-02";
    public static final String LZRQ = "2019-08-16";

    public static String rybsfw(int count) {

        List<Map<String, String>> list = getEmps(count);

        long start = System.currentTimeMillis();
        String ryxxbsId = ServyouService.ryxxbs(list);
        System.out.println("受理id:" + ryxxbsId + "|报送" + count + "人员耗时:" + ((System.currentTimeMillis() - start) / 1000));

        String request = ServyouService.ryxxbsztcx(ryxxbsId);
        System.out.println("报送人员查询结果：" + request + "报送" + count + "人员查询结果总体耗时:" + ((System.currentTimeMillis() - start) / 1000));

        start = System.currentTimeMillis();
        String acceptId = ServyouService.ryxxfk(ryxxbsId);
        System.out.println("人员报送反馈接口耗时：" + (System.currentTimeMillis() - start) / 1000);

        ServyouService.ryxxfkztcx(acceptId);
        System.out.println("人员报送反馈查询总体耗时：" + ((System.currentTimeMillis() - start) / 1000));

        return acceptId;
    }

    public static List<Map<String, String>> getEmps(int count) {
        List<Map<String, String>> list = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            Map<String, String> map = new HashMap<>();
            String sfzhm = ServyouUtil.getSfzhm();
//            map.put("zzlx", ZJLX);
//            map.put("zzhm", sfzhm);
//            map.put("xm", ServyouUtil.getRandomName());
//            map.put("gj", GJ);
//            map.put("xb", ServyouUtil.getRandomGender());
//            map.put("csny", ServyouUtil.getCsny(sfzhm));
//            map.put("nsrzt", STATUS);
//            map.put("lxdh", ServyouUtil.getRandomMobile());
//            map.put("sfgy", SFGY);
//            map.put("rzsgrq", RZSGRQ);
            map.put("zzlx", ZJLX);
            map.put("zzhm", "420802199008051917");
            map.put("xm", "刘晨辉");
            map.put("gj", GJ);
            map.put("xb", "男");
            map.put("csny", "1990-08-05");
            map.put("nsrzt", STATUS);
            map.put("lxdh", "18271800469");
            map.put("sfgy", SFGY);
            map.put("rzsgrq", RZSGRQ);

            map.put("lzrq", LZRQ);
            list.add(map);
        }
        return list;
    }
}
